package com.steed.rocketmq.producer.web;

import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.Producer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author za-zhubin002
 * Created in 15:51 2017/10/31
 */
@RestController
@Api(description = "经验值奖励规则")
public class DemoController {

    @Resource
    private Producer producer;

    @RequestMapping(value = "/producer/test", method = RequestMethod.POST)
    @ApiOperation(value = "生产")
    public String provideProduct(){
        producer.send(new Message("T-WOW-ACCOUNT-171026","test","hello world".getBytes()));
        return "done";
    }
}
